Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

files of /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/

(Leetcode) Find First and Last Position of Element in Sorted Array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/(Leetcode) Find First and Last Position of Element in Sorted Array.cpp
12 Views
0 Comments
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {

int n = nums.size();
Binary search.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Binary search.cpp
15 Views
0 Comments
class Solution {
public:
int search(vector<int>& nums, int target) {
int n = nums.size();
int start = 0;
Find Minimum in Rotated Sorted Array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Find Minimum in Rotated Sorted Array.cpp
17 Views
0 Comments
class Solution {
public:
int findMin(vector<int>& nums) {
int n = nums.size();
int start = 0;
int en
Find Peak Elements.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Find Peak Elements.cpp
11 Views
0 Comments
class Solution {
public:
int findPeakElement(vector<int>& arr) {
int n =arr.size();
if(n == 1) return 0;
if(arr[
First and Last Position of an Element In Sorted Array(CN).cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/First and Last Position of an Element In Sorted Array(CN).cpp
24 Views
0 Comments
#include <bits/stdc++.h>

int firstOcc(vector<int>& arr, int n, int k){
int start = 0;
int end = n-1;

in
Implement Lower Bound.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Implement Lower Bound.cpp
12 Views
0 Comments
int lowerBound(vector<int> arr, int n, int x) {

int start = 0;
int end = n-1;

int mid = start +(end - start) /2;
int
Implement Upper Bound.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Implement Upper Bound.cpp
17 Views
0 Comments
int upperBound(vector<int> &arr, int x, int n){
// Write your code here.
int start = 0;
int end = n-1;

int mid = start
Search In Rotated Sorted Array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Search In Rotated Sorted Array.cpp
17 Views
0 Comments
int search(vector<int>& arr, int n, int k)
{
// Write your code here.
// Return the position of K in ARR else return
Search Insert Position.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Search Insert Position.cpp
33 Views
0 Comments
int searchInsert(vector<int>& arr, int m)
{
// Write your code here.
int n = arr.size();
int start = 0;
int end = n-1;
Search in Rotated Sorted Array II.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Search in Rotated Sorted Array II.cpp
17 Views
0 Comments
class Solution {
public:
bool search(vector<int>& nums, int target) {
int start = 0;
int end = nums.size()-1;

w
Single Elements in Sorted Array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Binary Search/BS on 1D Arrays/Single Elements in Sorted Array.cpp
16 Views
0 Comments
class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int n = nums.size();
if(n == 1) return nums[0];
if(nu